package com.icangya.service.impl;

import com.icangya.DAO.IFbWxSuitcaseDAO;
import com.icangya.DAO.ILifePayDAO;
import com.icangya.DAO.IPayInfoDAO;
import com.icangya.domain.FbPayInfo;
import com.icangya.domain.FbWxSuitcaseDO;
import com.icangya.domain.LiefpayDO;
import com.icangya.service.IFbWxSuitcaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service("FbWxSuitcaseServiceImpl")
public class FbWxSuitcaseServiceImpl implements IFbWxSuitcaseService{

    @Autowired
    private IFbWxSuitcaseDAO iFbWxSuitcaseDAO;

    @Autowired
    private ILifePayDAO iLifePayDAO;

    @Autowired
    private IPayInfoDAO iPayInfoDAO;
    @Override
    public void save(FbWxSuitcaseDO fbWxSuitcaseDO) {
        iFbWxSuitcaseDAO.save(fbWxSuitcaseDO);
    }


    @Override
    public LiefpayDO getLiefpayDOByMerchant_order_sn(String merchant_order_sn) {
        return iLifePayDAO.getLiefpayDOByMerchant_order_sn(merchant_order_sn);

    }

    @Override
    public long savePayInfo(FbPayInfo fbPayInfo) {
        return (long) iPayInfoDAO.save(fbPayInfo);

    }

    @Override
    public FbPayInfo getPayInfoByMchTradeId(String mchTradeId) {

        return iPayInfoDAO.getPayInfoByMchTradeId(mchTradeId);

    }

    @Override
    public boolean updatePayinfo(FbPayInfo fbPayInfo) {

        return iPayInfoDAO.update(fbPayInfo);

    }

    @Override
    public Integer selectFbWxSuitcaseServiceByUserid(long  userid) {

        return iFbWxSuitcaseDAO.selectFbWxSuitcaseServiceByUseridAndCreateTime(userid);

    }

    @Override
    public long saveLiefpayDO(LiefpayDO liefpayDO) {

        return (long) iLifePayDAO.save(liefpayDO);

    }

    @Override
    public boolean updateLiefpayDO(LiefpayDO liefpayDO) {

        return iLifePayDAO.update(liefpayDO);

    }
}
